package com.itheima.health.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: 15041
 * @Date: 10:00 2021/1/11
 * @ReturnType: 配置运行所有的请求跨越
 *Description:
*/
@Configuration //声明这是一个配置类
public class WebConfiguration implements WebMvcConfigurer {

    //重写
    @Override
    public void addCorsMappings(CorsRegistry registry) {

        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedMethods("*")
                .allowCredentials(true);

    }
}
